﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace ElectroSystem.Models
{
    public class RegisterModel
    {
        [Required(ErrorMessage = "Please enter your Username")]
        public string Username { get; set; }

        [Required(ErrorMessage = "Please enter your Password")]
        [StringLength(50, MinimumLength = 6, ErrorMessage = "Minimum length should be 6 characters")]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        [Required(ErrorMessage = "Please enter your Name")]
        public string Name { get; set; }

        [Required(ErrorMessage = "Please enter your Surname")]
        public string Surname { get; set; }

        [Required(ErrorMessage = "Please enter your Email")]
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}", ErrorMessage = "Email is invalid")]
        public string Email { get; set; }

        [Required(ErrorMessage = "Please enter your Mobile Number")]
        [RegularExpression("^[0-9]+$", ErrorMessage = "Invalid Mobile Number")]
        public string MobileNo { get; set; }

        [Required(ErrorMessage = "Please enter your Residence")]
        public string Residence { get; set; }

        [Required(ErrorMessage = "Please enter your Stret")]
        public string Street { get; set; }

        [Required(ErrorMessage = "Please enter your Town")]
        public string Town { get; set; }

        [Required(ErrorMessage = "Please select a Country")]
        public string Country { get; set; }

        [Required(ErrorMessage = "Please enter your Pin Number")]
        [RegularExpression(@"^[0-9]{4}$", ErrorMessage = "Enter a 4-digit pin")]
        public int PinNumber { get; set; }
    }
}